<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Jetson Inference: jetson-inference/backgroundNet.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="NVLogo_2D.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Jetson Inference
   </div>
   <div id="projectbrief">DNN Vision Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('backgroundNet_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">backgroundNet.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="backgroundNet_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * to deal in the Software without restriction, including without limitation</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span></div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * Software is furnished to do so, subject to the following conditions:</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * The above copyright notice and this permission notice shall be included in</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * all copies or substantial portions of the Software.</span></div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL</span></div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span></div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * DEALINGS IN THE SOFTWARE.</span></div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> */</span></div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160; </div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#ifndef __BACKGROUND_NET_H__</span></div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#define __BACKGROUND_NET_H__</span></div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="tensorNet_8h.html">tensorNet.h</a>&quot;</span></div>
<div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="cudaFilterMode_8h.html">jetson-utils/cudaFilterMode.h</a>&gt;</span></div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160; </div>
<div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="group__backgroundNet.html#gaedcfc9671390875215c85dcddd3cff09">   35</a></span>&#160;<span class="preprocessor">#define BACKGROUNDNET_DEFAULT_INPUT   &quot;input_0&quot;</span></div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160; </div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="group__backgroundNet.html#ga3ebbfc2bb8d09adb2e1505704ebedde6">   41</a></span>&#160;<span class="preprocessor">#define BACKGROUNDNET_DEFAULT_OUTPUT  &quot;output_0&quot;</span></div>
<div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160; </div>
<div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="group__backgroundNet.html#ga4ead266677aa864b484cae25a3c6062f">   47</a></span>&#160;<span class="preprocessor">#define BACKGROUNDNET_MODEL_TYPE &quot;background&quot;</span></div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160; </div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="group__backgroundNet.html#ga554b40e53cb2ec9b6768adaf32087f57">   53</a></span>&#160;<span class="preprocessor">#define BACKGROUNDNET_USAGE_STRING  &quot;backgroundNet arguments: \n&quot;                                       \</span></div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="preprocessor">                  &quot;  --network=NETWORK    pre-trained model to load, one of the following:\n&quot;   \</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="preprocessor">                  &quot;                           * u2net (default)\n&quot;                                              \</span></div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;<span class="preprocessor">                  &quot;  --model=MODEL        path to custom model to load (caffemodel, uff, or onnx)\n&quot;                            \</span></div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="preprocessor">                  &quot;  --input-blob=INPUT   name of the input layer (default is &#39;&quot; BACKGROUNDNET_DEFAULT_INPUT &quot;&#39;)\n&quot;     \</span></div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor">                  &quot;  --output-blob=OUTPUT name of the output layer (default is &#39;&quot; BACKGROUNDNET_DEFAULT_OUTPUT &quot;&#39;)\n&quot;   \</span></div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;<span class="preprocessor">                  &quot;  --profile            enable layer profiling in TensorRT\n\n&quot;</span></div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160; </div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160; </div>
<div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="group__backgroundNet.html">   66</a></span>&#160;<span class="keyword">class </span><a class="code" href="group__backgroundNet.html#classbackgroundNet">backgroundNet</a> : <span class="keyword">public</span> <a class="code" href="group__tensorNet.html#classtensorNet">tensorNet</a></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;{</div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;        <span class="keyword">static</span> <a class="code" href="group__backgroundNet.html#classbackgroundNet">backgroundNet</a>* <a class="code" href="group__backgroundNet.html#a95b3bab94c1a8a7142f72b470a85d22a">Create</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* network=<span class="stringliteral">&quot;u2net&quot;</span>, uint32_t maxBatchSize=<a class="code" href="group__tensorNet.html#ga5a46a965749d6118e01307fd4d4865c9">DEFAULT_MAX_BATCH_SIZE</a>, </div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;                                                        <a class="code" href="group__tensorNet.html#gaac6604fd52c6e5db82877390e0378623">precisionType</a> precision=<a class="code" href="group__tensorNet.html#ggaac6604fd52c6e5db82877390e0378623a1d325738f49e8e4c424ff671624e66f9">TYPE_FASTEST</a>, <a class="code" href="group__tensorNet.html#gaa5d3f9981cdbd91516c1474006a80fe4">deviceType</a> device=<a class="code" href="group__tensorNet.html#ggaa5d3f9981cdbd91516c1474006a80fe4adc7f3f88455afa81458863e5b3092e4b">DEVICE_GPU</a>, <span class="keywordtype">bool</span> allowGPUFallback=<span class="keyword">true</span> );</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        </div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;        <span class="keyword">static</span> <a class="code" href="group__backgroundNet.html#classbackgroundNet">backgroundNet</a>* <a class="code" href="group__backgroundNet.html#a95b3bab94c1a8a7142f72b470a85d22a">Create</a>( <span class="keyword">const</span> <span class="keywordtype">char</span>* model_path, </div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;                                                        <span class="keyword">const</span> <span class="keywordtype">char</span>* input=<a class="code" href="group__backgroundNet.html#gaedcfc9671390875215c85dcddd3cff09">BACKGROUNDNET_DEFAULT_INPUT</a>, </div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;                                                        <span class="keyword">const</span> <span class="keywordtype">char</span>* output=<a class="code" href="group__backgroundNet.html#ga3ebbfc2bb8d09adb2e1505704ebedde6">BACKGROUNDNET_DEFAULT_OUTPUT</a>, </div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;                                                        uint32_t maxBatchSize=<a class="code" href="group__tensorNet.html#ga5a46a965749d6118e01307fd4d4865c9">DEFAULT_MAX_BATCH_SIZE</a>, </div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;                                                        <a class="code" href="group__tensorNet.html#gaac6604fd52c6e5db82877390e0378623">precisionType</a> precision=<a class="code" href="group__tensorNet.html#ggaac6604fd52c6e5db82877390e0378623a1d325738f49e8e4c424ff671624e66f9">TYPE_FASTEST</a>,</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;                                                        <a class="code" href="group__tensorNet.html#gaa5d3f9981cdbd91516c1474006a80fe4">deviceType</a> device=<a class="code" href="group__tensorNet.html#ggaa5d3f9981cdbd91516c1474006a80fe4adc7f3f88455afa81458863e5b3092e4b">DEVICE_GPU</a>, <span class="keywordtype">bool</span> allowGPUFallback=<span class="keyword">true</span> );</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;        </div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        <span class="keyword">static</span> <a class="code" href="group__backgroundNet.html#classbackgroundNet">backgroundNet</a>* <a class="code" href="group__backgroundNet.html#a95b3bab94c1a8a7142f72b470a85d22a">Create</a>( <span class="keywordtype">int</span> argc, <span class="keywordtype">char</span>** argv );</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160; </div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;        <span class="keyword">static</span> <a class="code" href="group__backgroundNet.html#classbackgroundNet">backgroundNet</a>* <a class="code" href="group__backgroundNet.html#a95b3bab94c1a8a7142f72b470a85d22a">Create</a>( <span class="keyword">const</span> <a class="code" href="group__commandLine.html#classcommandLine">commandLine</a>&amp; cmdLine );</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="group__backgroundNet.html#a0f195cca41ffdb36e82bbd5aeca1c86b">  102</a></span>&#160;        <span class="keyword">static</span> <span class="keyword">inline</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="group__backgroundNet.html#a0f195cca41ffdb36e82bbd5aeca1c86b">Usage</a>()               { <span class="keywordflow">return</span> <a class="code" href="group__backgroundNet.html#ga554b40e53cb2ec9b6768adaf32087f57">BACKGROUNDNET_USAGE_STRING</a>; }</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160; </div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;        <span class="keyword">virtual</span> <a class="code" href="group__backgroundNet.html#a6b474d88a5447623257e0f473352b465">~backgroundNet</a>();</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;        </div>
<div class="line"><a name="l00118"></a><span class="lineno"><a class="line" href="group__backgroundNet.html#adf58aca64daa5f7b6267df690bc00c92">  118</a></span>&#160;        <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt; <span class="keywordtype">int</span> <a class="code" href="group__backgroundNet.html#adf58aca64daa5f7b6267df690bc00c92">Process</a>( T* image, uint32_t width, uint32_t height,</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;                                                            <a class="code" href="group__cudaFilter.html#ga25d4283643163befe99948d24cc53311">cudaFilterMode</a> filter=<a class="code" href="group__cudaFilter.html#gga25d4283643163befe99948d24cc53311ad8e5de74ec16a7e07145b7c18c885094">FILTER_LINEAR</a>, <span class="keywordtype">bool</span> maskAlpha=<span class="keyword">true</span> )  { <span class="keywordflow">return</span> <a class="code" href="group__backgroundNet.html#adf58aca64daa5f7b6267df690bc00c92">Process</a>((<span class="keywordtype">void</span>*)image, width, height, imageFormatFromType&lt;T&gt;(), filter, maskAlpha); }</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;        </div>
<div class="line"><a name="l00131"></a><span class="lineno"><a class="line" href="group__backgroundNet.html#a21a10a6dbc5d74d9f6723cfc95d64b55">  131</a></span>&#160;        <span class="keyword">template</span>&lt;<span class="keyword">typename</span> T&gt; <span class="keywordtype">int</span> <a class="code" href="group__backgroundNet.html#a21a10a6dbc5d74d9f6723cfc95d64b55">Process</a>( T* input, T* output, uint32_t width, uint32_t height,</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;                                                            <a class="code" href="group__cudaFilter.html#ga25d4283643163befe99948d24cc53311">cudaFilterMode</a> filter=<a class="code" href="group__cudaFilter.html#gga25d4283643163befe99948d24cc53311ad8e5de74ec16a7e07145b7c18c885094">FILTER_LINEAR</a>, <span class="keywordtype">bool</span> maskAlpha=<span class="keyword">true</span> )  { <span class="keywordflow">return</span> <a class="code" href="group__backgroundNet.html#adf58aca64daa5f7b6267df690bc00c92">Process</a>((<span class="keywordtype">void</span>*)input, (<span class="keywordtype">void</span>*)output, width, height, imageFormatFromType&lt;T&gt;(), filter, maskAlpha); }</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;        </div>
<div class="line"><a name="l00143"></a><span class="lineno"><a class="line" href="group__backgroundNet.html#a4c90e4c05c2bfb87b4c87ad7c746609d">  143</a></span>&#160;        <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="group__backgroundNet.html#a4c90e4c05c2bfb87b4c87ad7c746609d">Process</a>( <span class="keywordtype">void</span>* image, uint32_t width, uint32_t height, <a class="code" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a> format,</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;                                         <a class="code" href="group__cudaFilter.html#ga25d4283643163befe99948d24cc53311">cudaFilterMode</a> filter=<a class="code" href="group__cudaFilter.html#gga25d4283643163befe99948d24cc53311ad8e5de74ec16a7e07145b7c18c885094">FILTER_LINEAR</a>, <span class="keywordtype">bool</span> maskAlpha=<span class="keyword">true</span> )                                     { <span class="keywordflow">return</span> <a class="code" href="group__backgroundNet.html#adf58aca64daa5f7b6267df690bc00c92">Process</a>(image, image, width, height, format, filter, maskAlpha); }</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;                            </div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="group__backgroundNet.html#adf58aca64daa5f7b6267df690bc00c92">Process</a>( <span class="keywordtype">void</span>* input, <span class="keywordtype">void</span>* output, uint32_t width, uint32_t height, <a class="code" href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a> format,</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;                            <a class="code" href="group__cudaFilter.html#ga25d4283643163befe99948d24cc53311">cudaFilterMode</a> filter=<a class="code" href="group__cudaFilter.html#gga25d4283643163befe99948d24cc53311ad8e5de74ec16a7e07145b7c18c885094">FILTER_LINEAR</a>, <span class="keywordtype">bool</span> maskAlpha=<span class="keyword">true</span> );</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160; </div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        <a class="code" href="group__backgroundNet.html#a4a5cb05216bf994f05887d44b249f6b4">backgroundNet</a>();</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;        </div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="group__backgroundNet.html#ac3d21c4f9d5982c1e317ce7b01d3dea4">init</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* model_path, <span class="keyword">const</span> <span class="keywordtype">char</span>* input, <span class="keyword">const</span> <span class="keywordtype">char</span>* output, uint32_t maxBatchSize, <a class="code" href="group__tensorNet.html#gaac6604fd52c6e5db82877390e0378623">precisionType</a> precision, <a class="code" href="group__tensorNet.html#gaa5d3f9981cdbd91516c1474006a80fe4">deviceType</a> device, <span class="keywordtype">bool</span> allowGPUFallback );</div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160; </div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;};</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160; </div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160; </div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="agroup__backgroundNet_html_a95b3bab94c1a8a7142f72b470a85d22a"><div class="ttname"><a href="group__backgroundNet.html#a95b3bab94c1a8a7142f72b470a85d22a">backgroundNet::Create</a></div><div class="ttdeci">static backgroundNet * Create(const char *network=&quot;u2net&quot;, uint32_t maxBatchSize=DEFAULT_MAX_BATCH_SIZE, precisionType precision=TYPE_FASTEST, deviceType device=DEVICE_GPU, bool allowGPUFallback=true)</div><div class="ttdoc">Load a pre-trained model.</div></div>
<div class="ttc" id="agroup__backgroundNet_html_a4c90e4c05c2bfb87b4c87ad7c746609d"><div class="ttname"><a href="group__backgroundNet.html#a4c90e4c05c2bfb87b4c87ad7c746609d">backgroundNet::Process</a></div><div class="ttdeci">bool Process(void *image, uint32_t width, uint32_t height, imageFormat format, cudaFilterMode filter=FILTER_LINEAR, bool maskAlpha=true)</div><div class="ttdoc">Perform background subtraction/removal on the image (in-place).</div><div class="ttdef"><b>Definition:</b> backgroundNet.h:143</div></div>
<div class="ttc" id="agroup__backgroundNet_html_classbackgroundNet"><div class="ttname"><a href="group__backgroundNet.html#classbackgroundNet">backgroundNet</a></div><div class="ttdoc">Background subtraction/removal with DNNs, using TensorRT.</div><div class="ttdef"><b>Definition:</b> backgroundNet.h:66</div></div>
<div class="ttc" id="agroup__cudaFilter_html_gga25d4283643163befe99948d24cc53311ad8e5de74ec16a7e07145b7c18c885094"><div class="ttname"><a href="group__cudaFilter.html#gga25d4283643163befe99948d24cc53311ad8e5de74ec16a7e07145b7c18c885094">FILTER_LINEAR</a></div><div class="ttdeci">@ FILTER_LINEAR</div><div class="ttdoc">Bilinear filtering.</div><div class="ttdef"><b>Definition:</b> cudaFilterMode.h:38</div></div>
<div class="ttc" id="agroup__backgroundNet_html_a4a5cb05216bf994f05887d44b249f6b4"><div class="ttname"><a href="group__backgroundNet.html#a4a5cb05216bf994f05887d44b249f6b4">backgroundNet::backgroundNet</a></div><div class="ttdeci">backgroundNet()</div></div>
<div class="ttc" id="agroup__backgroundNet_html_a6b474d88a5447623257e0f473352b465"><div class="ttname"><a href="group__backgroundNet.html#a6b474d88a5447623257e0f473352b465">backgroundNet::~backgroundNet</a></div><div class="ttdeci">virtual ~backgroundNet()</div><div class="ttdoc">Destroy.</div></div>
<div class="ttc" id="agroup__tensorNet_html_ggaa5d3f9981cdbd91516c1474006a80fe4adc7f3f88455afa81458863e5b3092e4b"><div class="ttname"><a href="group__tensorNet.html#ggaa5d3f9981cdbd91516c1474006a80fe4adc7f3f88455afa81458863e5b3092e4b">DEVICE_GPU</a></div><div class="ttdeci">@ DEVICE_GPU</div><div class="ttdoc">GPU (if multiple GPUs are present, a specific GPU can be selected with cudaSetDevice()</div><div class="ttdef"><b>Definition:</b> tensorNet.h:131</div></div>
<div class="ttc" id="agroup__tensorNet_html_gaa5d3f9981cdbd91516c1474006a80fe4"><div class="ttname"><a href="group__tensorNet.html#gaa5d3f9981cdbd91516c1474006a80fe4">deviceType</a></div><div class="ttdeci">deviceType</div><div class="ttdoc">Enumeration for indicating the desired device that the network should run on, if available in hardwar...</div><div class="ttdef"><b>Definition:</b> tensorNet.h:129</div></div>
<div class="ttc" id="agroup__backgroundNet_html_a21a10a6dbc5d74d9f6723cfc95d64b55"><div class="ttname"><a href="group__backgroundNet.html#a21a10a6dbc5d74d9f6723cfc95d64b55">backgroundNet::Process</a></div><div class="ttdeci">int Process(T *input, T *output, uint32_t width, uint32_t height, cudaFilterMode filter=FILTER_LINEAR, bool maskAlpha=true)</div><div class="ttdoc">Perform background subtraction/removal on the image.</div><div class="ttdef"><b>Definition:</b> backgroundNet.h:131</div></div>
<div class="ttc" id="atensorNet_8h_html"><div class="ttname"><a href="tensorNet_8h.html">tensorNet.h</a></div></div>
<div class="ttc" id="agroup__tensorNet_html_ggaac6604fd52c6e5db82877390e0378623a1d325738f49e8e4c424ff671624e66f9"><div class="ttname"><a href="group__tensorNet.html#ggaac6604fd52c6e5db82877390e0378623a1d325738f49e8e4c424ff671624e66f9">TYPE_FASTEST</a></div><div class="ttdeci">@ TYPE_FASTEST</div><div class="ttdoc">The fastest detected precision should be use (i.e.</div><div class="ttdef"><b>Definition:</b> tensorNet.h:105</div></div>
<div class="ttc" id="agroup__backgroundNet_html_ga554b40e53cb2ec9b6768adaf32087f57"><div class="ttname"><a href="group__backgroundNet.html#ga554b40e53cb2ec9b6768adaf32087f57">BACKGROUNDNET_USAGE_STRING</a></div><div class="ttdeci">#define BACKGROUNDNET_USAGE_STRING</div><div class="ttdoc">Standard command-line options able to be passed to backgroundNet::Create()</div><div class="ttdef"><b>Definition:</b> backgroundNet.h:53</div></div>
<div class="ttc" id="agroup__backgroundNet_html_ga3ebbfc2bb8d09adb2e1505704ebedde6"><div class="ttname"><a href="group__backgroundNet.html#ga3ebbfc2bb8d09adb2e1505704ebedde6">BACKGROUNDNET_DEFAULT_OUTPUT</a></div><div class="ttdeci">#define BACKGROUNDNET_DEFAULT_OUTPUT</div><div class="ttdoc">Name of default output layer for backgroundNet model.</div><div class="ttdef"><b>Definition:</b> backgroundNet.h:41</div></div>
<div class="ttc" id="agroup__cudaFilter_html_ga25d4283643163befe99948d24cc53311"><div class="ttname"><a href="group__cudaFilter.html#ga25d4283643163befe99948d24cc53311">cudaFilterMode</a></div><div class="ttdeci">cudaFilterMode</div><div class="ttdoc">Enumeration of interpolation filtering modes.</div><div class="ttdef"><b>Definition:</b> cudaFilterMode.h:35</div></div>
<div class="ttc" id="agroup__backgroundNet_html_gaedcfc9671390875215c85dcddd3cff09"><div class="ttname"><a href="group__backgroundNet.html#gaedcfc9671390875215c85dcddd3cff09">BACKGROUNDNET_DEFAULT_INPUT</a></div><div class="ttdeci">#define BACKGROUNDNET_DEFAULT_INPUT</div><div class="ttdoc">Name of default input layer for backgroundNet model.</div><div class="ttdef"><b>Definition:</b> backgroundNet.h:35</div></div>
<div class="ttc" id="agroup__tensorNet_html_gaac6604fd52c6e5db82877390e0378623"><div class="ttname"><a href="group__tensorNet.html#gaac6604fd52c6e5db82877390e0378623">precisionType</a></div><div class="ttdeci">precisionType</div><div class="ttdoc">Enumeration for indicating the desired precision that the network should run in, if available in hard...</div><div class="ttdef"><b>Definition:</b> tensorNet.h:102</div></div>
<div class="ttc" id="agroup__tensorNet_html_classtensorNet"><div class="ttname"><a href="group__tensorNet.html#classtensorNet">tensorNet</a></div><div class="ttdoc">Abstract class for loading a tensor network with TensorRT.</div><div class="ttdef"><b>Definition:</b> tensorNet.h:218</div></div>
<div class="ttc" id="agroup__backgroundNet_html_a0f195cca41ffdb36e82bbd5aeca1c86b"><div class="ttname"><a href="group__backgroundNet.html#a0f195cca41ffdb36e82bbd5aeca1c86b">backgroundNet::Usage</a></div><div class="ttdeci">static const char * Usage()</div><div class="ttdoc">Usage string for command line arguments to Create()</div><div class="ttdef"><b>Definition:</b> backgroundNet.h:102</div></div>
<div class="ttc" id="acudaFilterMode_8h_html"><div class="ttname"><a href="cudaFilterMode_8h.html">cudaFilterMode.h</a></div></div>
<div class="ttc" id="agroup__tensorNet_html_ga5a46a965749d6118e01307fd4d4865c9"><div class="ttname"><a href="group__tensorNet.html#ga5a46a965749d6118e01307fd4d4865c9">DEFAULT_MAX_BATCH_SIZE</a></div><div class="ttdeci">#define DEFAULT_MAX_BATCH_SIZE</div><div class="ttdoc">Default maximum batch size.</div><div class="ttdef"><b>Definition:</b> tensorNet.h:88</div></div>
<div class="ttc" id="agroup__backgroundNet_html_adf58aca64daa5f7b6267df690bc00c92"><div class="ttname"><a href="group__backgroundNet.html#adf58aca64daa5f7b6267df690bc00c92">backgroundNet::Process</a></div><div class="ttdeci">int Process(T *image, uint32_t width, uint32_t height, cudaFilterMode filter=FILTER_LINEAR, bool maskAlpha=true)</div><div class="ttdoc">Perform background subtraction/removal on the image (in-place).</div><div class="ttdef"><b>Definition:</b> backgroundNet.h:118</div></div>
<div class="ttc" id="agroup__backgroundNet_html_ac3d21c4f9d5982c1e317ce7b01d3dea4"><div class="ttname"><a href="group__backgroundNet.html#ac3d21c4f9d5982c1e317ce7b01d3dea4">backgroundNet::init</a></div><div class="ttdeci">bool init(const char *model_path, const char *input, const char *output, uint32_t maxBatchSize, precisionType precision, deviceType device, bool allowGPUFallback)</div></div>
<div class="ttc" id="agroup__commandLine_html_classcommandLine"><div class="ttname"><a href="group__commandLine.html#classcommandLine">commandLine</a></div><div class="ttdoc">Command line parser for extracting flags, values, and strings.</div><div class="ttdef"><b>Definition:</b> commandLine.h:35</div></div>
<div class="ttc" id="agroup__imageFormat_html_ga931c48e08f361637d093355d64583406"><div class="ttname"><a href="group__imageFormat.html#ga931c48e08f361637d093355d64583406">imageFormat</a></div><div class="ttdeci">imageFormat</div><div class="ttdoc">The imageFormat enum is used to identify the pixel format and colorspace of an image.</div><div class="ttdef"><b>Definition:</b> imageFormat.h:49</div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_2e4d84877693cd000e5cb535f4b23486.html">jetson-inference</a></li><li class="navelem"><a class="el" href="backgroundNet_8h.html">backgroundNet.h</a></li>
    <li class="footer">Generated on Tue Mar 28 2023 14:27:58 for Jetson Inference by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
